# -*- coding: utf-8 -*-
# 引入依赖包
# 最低SDK版本要求：viapi20230117的SDK版本需大于等于2.0.1。
# 可以在此仓库地址中引用最新版本SDK：https://pypi.org/project/alibabacloud-viapi20230117/
# pip install alibabacloud_viapi20230117 -i https://pypi.org/simple

from alibabacloud_tea_openapi.models import Config
from alibabacloud_tea_util.models import RuntimeOptions
from alibabacloud_viapi20230117.client import Client
from alibabacloud_viapi20230117.models import GetAsyncJobResultRequest

config = Config(
  access_key_id='LTAI5t6GK5tGDsMU7jEGdEkM',
  access_key_secret='8H1pdFYccKdcDPciYKFtlZUsmCqnPM',
  endpoint='viapi.cn-shanghai.aliyuncs.com',
  region_id='cn-shanghai'
)
get_async_job_result_request = GetAsyncJobResultRequest(
    job_id='39300149-807B-5EF1-8DCD-8FC368604A32'
)
runtime = RuntimeOptions()
try:
  # 初始化Client
  client = Client(config)
  response = client.get_async_job_result_with_options(get_async_job_result_request, runtime)
  # 获取整体结果
  print(response.body)
except Exception as error:
  # 获取整体报错信息
  print(error)
  # 获取单个字段
  print(error.code)
